
<div id="rangeCalendar">
    <table>
        <tr>
            <th>
                <input id="rangeCalendarCheckbox" type="checkbox" title="вкл/выкл" checked="checked" onchange="rangeCalendarToggle()" />
                <label for="rangeCalendarCheckbox">Период отдыха:</label>
                <input type="text" readonly="readonly" id="rangeDatepick" />
            </th>
        </tr>
    </table>
    <div class="clear"></div>
</div>

<script language="javascript" type="text/javascript">

    var calendar;

    $(function() {
        $('#rangeDatepick').datepick({
            rangeSelect: true,
            numberOfMonths: 2,
            changeMonth: false,
            changeYear: false,
            minDate: '<?php echo sfConfig::get( 'app_season_begin' ) ?>',
            maxDate: '<?php echo sfConfig::get( 'app_season_end' ) ?>',
            defaultDate: '01.06.2010',
            onClose: function(date) {
        	    calendar = date;
            }
        });
        rangeCalendarToggle();
    });

    function rangeCalendarToggle()
    {
    	if ( $('#rangeCalendarCheckbox').is(':checked') )
        {
            $("#rangeDatepick").datepick('enable');
            calendar = $("#rangeDatepick").val();
        }
        else
        {
            $("#rangeDatepick").datepick('disable');
            calendar = '';
        }
    }

</script>
